/**
 * * 设置不能访问的时间段
 */

module.exports = () => {
  return async (ctx, next) => {
    const currentHour = new Date().getHours();
    if (currentHour >= 0 && currentHour <= 23) {
      await next();
    } else {
      ctx.body = {
        code: 500,
        msg: '当前时段限制认证、更新，请在7:00~23:00再执行该操作',
      };
    }
  };
};
